package main

import (
	"fmt"
	"net"
)

// tcp client端
func main() {
	// 1. 与server建立连接
	conn, err := net.Dial("tcp", "127.0.0.1:8000")
	if err != nil {
		fmt.Println("err :", err)
		return
	}
	// 2. 发送数据
	for i := 0; i < 20; i++ {
		conn.Write([]byte(" srart this is a str end "))
	}
	conn.Close()
}
